<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="/static/js3/jQuery-2.1.4/jquery-2.1.4.min.js"></script>
    <script>
        $(function () {
            $('#but1').bind('click',function () {
                alert(1);
            });
            $('.mybtn').bind('click',function () {
                alert(2);
            });
            $('#but4').click(function () {
                alert(4)
            })
            $('#but5').on('click',function () {
                alert(5)
            })
            $('#btns>button').click(function () {
                console.log(this);
                console.log($(this));
            })
            $('#but6').on('click',function () {
                $('div').append('<button id="but9">按钮9</button>');
            })
        })
    </script>
</head>
<body>
<button id="but1">按钮1</button>
<button id="but2" class="mybtn">按钮2</button>
<button id="but3" class="mybtn">按钮3</button>
<button id="but4">按钮4</button>
<div id="btns">
    <button id="but5">按钮5</button>
    <button id="but6">按钮6</button>
    <button id="but7">按钮7</button>
    <button id="but8">按钮8</button>
</div>
</body>
</html>